<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>Tk_CanvasPs manual page - Tk Library Procedures</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">Tk C API</a> <small>&gt;</small> CanvPsY</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<DL>
<DD><A HREF="CanvPsY.htm#M2" NAME="L21">NAME</A>
<DL><DD>Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple &mdash; utility procedures for generating Postscript for canvases</DD></DL>
<DD><A HREF="CanvPsY.htm#M3" NAME="L22">SYNOPSIS</A>
<DL>
<DD><B>#include &lt;tk.h&gt;</B>
<DD>double
<DD><B>Tk_CanvasPsY</B>(<I>canvas, canvasY</I>)
<DD>int
<DD><B>Tk_CanvasPsBitmap</B>(<I>interp, canvas, bitmap, x, y, width, height</I>)
<DD>int
<DD><B>Tk_CanvasPsColor</B>(<I>interp, canvas, colorPtr</I>)
<DD>int
<DD><B>Tk_CanvasPsFont</B>(<I>interp, canvas, tkFont</I>)
<DD><B>Tk_CanvasPsPath</B>(<I>interp, canvas, coordPtr, numPoints</I>)
<DD>int
<DD><B>Tk_CanvasPsStipple</B>(<I>interp, canvas, bitmap</I>)
</DL>
<DD><A HREF="CanvPsY.htm#M4" NAME="L23">ARGUMENTS</A>
<DL class="arguments">
</DL>
<DD><A HREF="CanvPsY.htm#M5" NAME="L24">DESCRIPTION</A>
<DD><A HREF="CanvPsY.htm#M6" NAME="L25">KEYWORDS</A>
</DL>
<H3><A NAME="M2">NAME</A></H3>
Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple &mdash; utility procedures for generating Postscript for canvases
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>#include &lt;tk.h&gt;</B><BR>
double<BR>
<B>Tk_CanvasPsY</B>(<I>canvas, canvasY</I>)<BR>
int<BR>
<B>Tk_CanvasPsBitmap</B>(<I>interp, canvas, bitmap, x, y, width, height</I>)<BR>
int<BR>
<B>Tk_CanvasPsColor</B>(<I>interp, canvas, colorPtr</I>)<BR>
int<BR>
<B>Tk_CanvasPsFont</B>(<I>interp, canvas, tkFont</I>)<BR>
<B>Tk_CanvasPsPath</B>(<I>interp, canvas, coordPtr, numPoints</I>)<BR>
int<BR>
<B>Tk_CanvasPsStipple</B>(<I>interp, canvas, bitmap</I>)<BR>
<H3><A NAME="M4">ARGUMENTS</A></H3>
<DL class="arguments">
<DT>Tk_Canvas <B><A HREF="../TkCmd/canvas.htm">canvas</A></B> (in)<DD>
A token that identifies a canvas widget for which Postscript is
being generated.
<P><DT>double <B>canvasY</B> (in)<DD>
Y-coordinate in the space of the canvas.
<P><DT><A HREF="../TclLib/Interp.htm">Tcl_Interp</A> <B>*interp</B> (in/out)<DD>
A Tcl interpreter;  Postscript is appended to its result, or the
result may be replaced with an error message.
<P><DT>Pixmap <B><A HREF="../TkCmd/bitmap.htm">bitmap</A></B> (in)<DD>
Bitmap to use for generating Postscript.
<P><DT>int <B>x</B> (in)<DD>
X-coordinate within <I>bitmap</I> of left edge of region to output.
<P><DT>int <B>y</B> (in)<DD>
Y-coordinate within <I>bitmap</I> of top edge of region to output.
<P><DT>int <B>width</B> (in)<DD>
Width of region of bitmap to output, in pixels.
<P><DT>int <B>height</B> (in)<DD>
Height of region of bitmap to output, in pixels.
<P><DT>XColor <B>*colorPtr</B> (in)<DD>
Information about color value to set in Postscript.
<P><DT><A HREF="../TkLib/GetFont.htm">Tk_Font</A> <B>tkFont</B> (in)<DD>
Font for which Postscript is to be generated.
<P><DT>double <B>*coordPtr</B> (in)<DD>
Pointer to an array of coordinates for one or more
points specified in canvas coordinates.
The order of values in <I>coordPtr</I> is x1, y1, x2, y2, x3, y3,
and so on.
<P><DT>int <B>numPoints</B> (in)<DD>
Number of points at <I>coordPtr</I>.
<P></DL>
<H3><A NAME="M5">DESCRIPTION</A></H3>
These procedures are called by canvas type managers to carry out
common functions related to generating Postscript.
Most of the procedures take a <I>canvas</I> argument, which
refers to a canvas widget for which Postscript is being
generated.
<P>
<B>Tk_CanvasPsY</B> takes as argument a y-coordinate in the space of
a canvas and returns the value that should be used for that point
in the Postscript currently being generated for <I>canvas</I>.
Y coordinates require transformation because Postscript uses an
origin at the lower-left corner whereas X uses an origin at the
upper-left corner.
Canvas x coordinates can be used directly in Postscript without
transformation.
<P>
<B>Tk_CanvasPsBitmap</B> generates Postscript to describe a region
of a bitmap.
The Postscript is generated in proper image data format for Postscript,
i.e., as data between angle brackets, one bit per pixel.
The Postscript is appended to the result of interpreter <I>interp</I>
and <B><A HREF="../TclCmd/catch.htm">TCL_OK</A></B> is returned unless an error occurs, in which case
<B><A HREF="../TclCmd/catch.htm">TCL_ERROR</A></B> is returned and the interpreter result is overwritten
with an error message.
<P>
<B>Tk_CanvasPsColor</B> generates Postscript to set the current color
to correspond to its <I>colorPtr</I> argument, taking into account any
color map specified in the <B>postscript</B> command.
It appends the Postscript to the interpreter <I>interp</I>'s result and returns
<B><A HREF="../TclCmd/catch.htm">TCL_OK</A></B> unless an error occurs, in which case <B><A HREF="../TclCmd/catch.htm">TCL_ERROR</A></B> is
returned and the interpreter's result is overwritten with an error message.
<P>
<B>Tk_CanvasPsFont</B> generates Postscript that sets the current font
to match <I>tkFont</I> as closely as possible.
<B>Tk_CanvasPsFont</B> takes into account any font map specified
in the <B>postscript</B> command, and it does
the best it can at mapping X fonts to Postscript fonts.
It appends the Postscript to interpreter <I>interp</I>'s result and
returns <B><A HREF="../TclCmd/catch.htm">TCL_OK</A></B> unless an error occurs, in which case
<B><A HREF="../TclCmd/catch.htm">TCL_ERROR</A></B> is returned and the interpreter's result is
overwritten with an error message.
<P>
<B>Tk_CanvasPsPath</B> generates Postscript to set the current path
to the set of points given by <I>coordPtr</I> and <I>numPoints</I>.
It appends the resulting Postscript to the result of interpreter <I>interp</I>.
<P>
<B>Tk_CanvasPsStipple</B> generates Postscript that will fill the
current path in stippled fashion.
It uses <I>bitmap</I> as the stipple pattern and the current Postscript
color;  ones in the stipple bitmap are drawn in the current color, and
zeroes are not drawn at all.
The Postscript is appended to interpreter <I>interp</I>'s result and
<B><A HREF="../TclCmd/catch.htm">TCL_OK</A></B> is returned, unless an error occurs, in which case
<B><A HREF="../TclCmd/catch.htm">TCL_ERROR</A></B> is returned and the interpreter's result is
overwritten with an error message.
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/B.htm#bitmap">bitmap</A>, <A href="../Keywords/C.htm#canvas">canvas</A>, <A href="../Keywords/C.htm#color">color</A>, <A href="../Keywords/F.htm#font">font</A>, <A href="../Keywords/P.htm#path">path</A>, <A href="../Keywords/P.htm#Postscript">Postscript</A>, <A href="../Keywords/S.htm#stipple">stipple</A>
<div class="copy">Copyright &copy; 1994-1996 Sun Microsystems, Inc.
</div>
</BODY></HTML>
